<!DOCTYPE HTML>
<html>

<head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
      <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
      <title>Hello APP</title>
      <link rel="stylesheet" type="text/css" href="../css/api.css" />

    <style>
    body{
        padding-top: 1.5rem;
    }
    .header{
          width: 94%;
          height: 2.5rem;
          line-height: 2.5rem;
          padding: 0.5rem 0.8rem;
          text-align: center;
          position: fixed;
          top:1.5rem;
          background-color: #fff;
      }
      .header_img{
        width: 6%;
        height: 45%;
        float: left;
        margin-top: 0.5rem;
      }
    .header_img img{
      width: 100%;
      height: 100%;
    }
    .header h3{
      line-height: 3rem;
      width: 90%;
      text-align: center;
    }
    .main{
      width:90%;
      height: auto;
      margin: 0 auto;
      background: white;
      padding-top: 4rem;
      /*padding-bottom: 4rem;*/
    }
    .main li{
      display: flex;
      background: white;
      margin:0.8rem 0;
    }
    .main li img{
      width:2.5rem;
      height: 2.5rem;
    }
    .txt{
      padding-left: 0.2rem;
    }
    .txt p:nth-child(2){
      font-size: 0.8rem;
      color: #999999;
      padding-bottom: 0.5rem;
    }
    .txt p:nth-child(3){
      font-size: 0.8rem;
      color: #666666;
      padding-bottom: 0.5rem;
    }
    .commwrap{
      width:100%;
      height:1.5rem;
      position: fixed;
      bottom: 1.2rem;
      left:0;
      right:0;
      padding: 0 0.8rem;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: space-between;
      z-index: 999;
    }
    #img{
    display: flex;
    flex-wrap: wrap;
    flex: 1;
    }

    #imgs{
      width: 30%;
      height:30%;
      margin-right: 0.5rem;
    }
    #imgs img{
      width: 100%;
      height: 100%;
    }
    input{
      width:75%;
      margin: 0 auto;
      height: 100%;
      background: rgb(242,242,242);
      padding: 0.8rem;
      border-radius: 1rem;
      outline: none;
    }

    .btn{
          font-size: 1.1rem;
          color:rgb(6,6,6)
    }

    </style>


</head>

<body>
  <div class="header">
    <div class="header_img">
      <img src="../image/u6.png" alt="" onclick="closewin()">
    </div>
    <h3>评论<span id="num">0</span></h3>
  </div>

    <ul class="main" id="saylist">

      <!-- <li>
        <img src="../image/a23.png">
        <div class="txt">
        <p>Lonoumey</p>
        <p>1天前</p>
        <p>今年不是应该送小猪摆件么？</p>
        <div id="img">
          <div id="imgs">
            <img src="../image/u64.png" alt="">
          </div>
          <div id="imgs">
            <img src="../image/u64.png" alt="">
          </div>
          <div id="imgs">
            <img src="../image/u64.png" alt="">
          </div>
          <div id="imgs">
            <img src="../image/u64.png" alt="">
          </div>
        </div>
      </div>
      </li> -->

    </ul>
    <!-- <div class="commwrap">
      <input type="text" placeholder="写下你的评论" id="say" />
      <button class="btn" onclick="fs()">发送</button>
    </div> -->

</body>

<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/common.js"></script>

<script type="text/javascript" src="../script/jquery-1.8.3.js"></script>
<script type="text/javascript">
var id
var pl_num
var page = 1;
var pagesize =20
var ok = true
apiready = function() {
  id = api.pageParam.id
  pl_num = api.pageParam.num
  $("#num").html('('+pl_num+')')
  get_list()
}

function get_list() {
  if(ok == false){
    return false
  }
  var html =''
  var obj = $api.byId('saylist');

  api.ajax({
      url: SITE_URL+'cur_api/cur/get_say',
      method: 'post',
      data: {
          values: {
              id: id,
              page:page,
              pagesize:pagesize
          }
      }
  },function(ret, err){
      if (ret) {
        if(ret.error==200){
          for (var i = 0; i < ret.data.length; i++) {
            var dat = ret.data[i]
            var time = gettime(dat.time)
            html +='<li>'
            html +='<img src="'+dat.head_img+'">'
            html +='<div class="txt">'
            html +='<p>'+dat.nick_name+'</p>'
            html +='<p>'+dat.time+'</p>'
            html +='<p>'+dat.say_some+'</p>'
            if(dat.img_list.length>0&&dat.img_list!=''){

              html +='<div id="img">'
              for (var ies = 0; ies < dat.img_list.length; ies++) {
                var data = dat.img_list[ies]
                html +='<div id="imgs">'
                html +='<img src="'+data+'" alt="">'
                html +='</div>'
              }
              html +='</div>'
            }
            html +='</div>'
            html +='</li>'
          }
          page+=1
          $api.append(obj, html);

        }else{
          msgcode('暂无更多评论')
          ok = false
        }
        //alert( JSON.stringify( ret ) );
      } else {
          //alert( JSON.stringify( err ) );
      }
  });

}

</script>

</html>
